// 转发微博视图
//  StatusRetweetView.swift
//  WeiboSwift
//
//  Created by Apple13 on 16/7/15.
//  Copyright © 2016年 yupeng. All rights reserved.
//

import UIKit

class StatusRetweetView: UIView {

    //懒加载控件
    private lazy var contentLabel:UILabel = {
        let label = UILabel(textColor:UIColor.greenColor(),fontSize: 13)
        
        //多行显示
        label.numberOfLines = 0
        return label
    }()
    
    
    //ViewModel属性
    var statusViewModel:StatusViewModel?{
        
        didSet {
            //设置转发微博内容
         contentLabel.text = statusViewModel?.retweetContent
        }
        
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setUpUI()
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    //添加视图约束
    private func setUpUI() {
        
//        contentLabel.backgroundColor = UIColor.blueColor()
        
        //添加控件
        addSubview(contentLabel)
        
        //设置约束
        contentLabel.snp_makeConstraints { (make) in
            make.top.equalTo(self).offset(HomeCellMargin)
            make.leading.equalTo(self).offset(HomeCellMargin)
            make.trailing.equalTo(self).offset(-HomeCellMargin)
        }
        
        
        //关键约束撑起视图
        self.snp_makeConstraints { (make) in
            make.bottom.equalTo(contentLabel).offset(HomeCellMargin)
        }
        
        
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
}
